@extends('default.mobile.layouts.personalPublic')
@section('title','其它信息-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">
@endsection
{{--头部标签--}}
@section('tag','其它信息')
@section('link') href="{{url('mobile/personal/resume_manage?parameter=other&resume_id='.$resume_id)}}" @endsection

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill" style="overflow: hidden">
        <div class="form_info" id="form_info">
            <form action="" onsubmit="return checkOther('#otherForm','/mobile/personal/add_other')"
                    method="post" id="otherForm" name="otherForm">
                {{csrf_field()}}
                <input type="hidden" name="resume_id" id="resume_id"  value="{{$resume_id}}">
                <dl class="arrow" id="title_select">
                    <input type="hidden" name="title" value="{{old('title')}}" id="title" />
                    <dt>主题<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择主题</span></dd>
                </dl>
                <dl class="arrow" id="content_description">
                    <dt>内容描述<span class="asterisk">*</span></dt>
                    <dd>
                        <textarea name="content" id="content" style="display: none;"></textarea>
                        <span class="select_text">请填写内容描述</span>
                    </dd>
                </dl>
                <div class="form_sub"><input type="submit" id="sub" value="保存"></div>
            </form>
        </div>
    </div>
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.textarea.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/resume_manage.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/zepto.scroll.js')}}"></script>

    <script>
        $(function(){
            var fill = $("#fill").find('#form_info');
            option_title.push({'value':'zdy','text':'自定义'});
            //主题
            fill.find("#title_select").select({
                select_title:'主题',                 //标题值
                hidden: '#title',                       //select隐藏表单值
                opt_data:option_title,                 //select选项值（数组json对象）
                callback:function(val){
                    if(val == 'zdy'){
                        if(fill.find("dl").find('#titInp').length <= 0){
                            var str = '';
                            str+='<dl>';
                            str+='<dt>主题名称<span class="asterisk">*</span></dt>';
                            str+='<dd><input type="text" name="titInp" id="titInp"  value="{{old('titInp')}}" placeholder="请输入主题名称" autocomplete="off"></dd>';
                            str+='</dl>';
                            fill.find("#title_select").after(str);
                        }
                    }else{
                        if(fill.find("dl").find('#titInp').length > 0){
                            fill.find("dl").find('#titInp').parents('dl').remove();
                        }
                    }
                }
            });
            //点击内容描述
            fill.find("#content_description").textarea({
                text_title:'内容描述',
                hidden: '#content'
            });
        });
    </script>
@endsection